import {defineStore} from 'pinia'


const searchStore = defineStore("searchStore", {
    state: () => {
        return {
            // 显示搜索框的标志
            searchFlag: false,
            searchText: ""
        }
    },
    getters: {
        getSearchFlag(state) {
            if (state.searchFlag) {
                return true
            }
            return false
        },
        getSearchText(state) {
            return state.searchText
        }
    },
    actions: {
        setSearchFlag(searchFlag) {
            this.searchFlag = searchFlag
        },
        setSearchText(searchText) {
            this.searchText = searchText
        }
    }
})

export default searchStore